In a system equipped with a microcontroller that provides a real-time interrupt (RTI), interrupts can be generated periodically or based on compare values, independently of the software loop or the CPU state. The primary function of the RTI is to provide a programmable clock period, separate from the system clock domain. Thus, the RTI can be used to provide periodic interrupts for an operating system. It can also be used for measuring elapsed time within an application or measuring time intervals for benchmarking code.
In an environment where a communication controller provides a global time to all nodes connected to a bus (e.g. TTCAN, TTP/C, FlexRay), time triggered applications need to be synchronized to this global time. However, in the event that the global time fails due to a problem on the bus, the application should continue without affecting the flow of operation.
In such an environment, operating systems require different time bases with different resolutions, ranging from a few hundred nanoseconds to hours. Conventionally, big counters of greater than 64 bits must be used to cover the entire range with a high frequency clock, which is needed for short timebases. Another requirement for some applications running in such an environment, e.g. safety-relevant automotive control applications, is to know exactly when certain peripheral events occurred.